<script setup lang="ts">
import { computed } from 'vue'
import { useI18n } from 'vue-i18n'

const { t } = useI18n()

// 使用国际化的应用名称和描述
const appName = computed(() => t('app.name'))
const description = computed(() => t('app.description'))

// 特性列表
const features = computed(() => [
  { 
    title: t('home.featuresList.electron.title'), 
    description: t('home.featuresList.electron.description'), 
    icon: 'Monitor' 
  },
  { 
    title: t('home.featuresList.vite.title'), 
    description: t('home.featuresList.vite.description'), 
    icon: 'Lightning' 
  },
  { 
    title: t('home.featuresList.vue.title'), 
    description: t('home.featuresList.vue.description'), 
    icon: 'ElementPlus' 
  },
])
</script>

<template>
  <div class="home-container">
    <div class="hero-section">
      <img src="../assets/electron-vite.svg" alt="Logo" class="logo" />
      <h1>{{ appName }}</h1>
      <p>{{ description }}</p>
      
      <div class="features">
        <h2>{{ t('home.features') }}</h2>
        <div class="features-grid">
          <el-card 
            v-for="(feature, index) in features" 
            :key="index" 
            class="feature-card"
          >
            <div class="feature-icon">
              <el-icon><component :is="feature.icon" /></el-icon>
            </div>
            <h3>{{ feature.title }}</h3>
            <p>{{ feature.description }}</p>
          </el-card>
        </div>
      </div>
    </div>
  </div>
</template>

<style scoped>
.home-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.hero-section {
  text-align: center;
  max-width: 800px;
}

.logo {
  width: 100px;
  height: 100px;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 1.8rem;
  margin: 2rem 0 1rem;
  color: var(--el-color-primary);
}

p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  color: var(--text-color);
}

.features {
  margin-top: 2rem;
  width: 100%;
}

.features-grid {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 1rem;
}

.feature-card {
  width: 200px;
  transition: transform 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--el-color-primary);
}

h3 {
  margin-bottom: 0.5rem;
}
</style> 